import java.util.HashSet;

public class Test {
    public static String setstring (String str) {
        char[] array=str.toCharArray();
        char[] arr1=new char[array.length];
        int size=0;
        for(int i=0;i<arr1.length;i++){
            int flag=0;
            for(int j=0;j<array.length;j++){
                flag=0;
                if(array[i]==arr1[j]){
                    break;
                }else{
                    flag=1;
                }
            }
            if(flag==1){
                arr1[size]=array[i];
                size++;
            }
        }
        char[] arr2=new char[size];
        for (int i=0;i<size;i++){
            arr2[i]=arr1[i];
        }
        String str1=new String(arr2);
        System.out.println(str1);
        return str1;
    }

    public static void main(String[] args){
        String str ="dda";
        String string=setstring (str);
    }
}
